/*用迭代器遍历map耗时，简单问题可以用pair或者用数组*/
#include <bits/stdc++.h>
using namespace std;

pair<int,int>place[1001];
map<pair<int,int>,int>mp;
int ans[5]={0};

int judge(int x,int y){
	if(mp[make_pair(x-1,y)]&&
		mp[make_pair(x+1,y)]&&
		mp[make_pair(x,y-1)]&&
		mp[make_pair(x,y+1)])
	{
		return 1;
	}
	return 0;
}

int fun(int x,int y){
	int ret=0;
	ret+=mp[make_pair(x-1,y-1)];
	ret+=mp[make_pair(x-1,y+1)];
	ret+=mp[make_pair(x+1,y-1)];
	ret+=mp[make_pair(x+1,y+1)];
	return ret;
}

int main(int argc, char const *argv[])
{
	int n;scanf("%d",&n);
	for(int i=0;i<n;i++){
		int x,y;scanf("%d%d",&x,&y);
		place[i].first=x;place[i].second=y;
		mp[place[i]]=1;
	}

	for(int i=0;i<1001;i++){
		int x=place[i].first,y=place[i].second;
		if(judge(x,y)){
			ans[fun(x,y)]++;
		}
	}

	for(int i=0;i<5;i++){
		printf("%d\n",ans[i]);
	}

	return 0;
}
